import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      component: resolve => require(['@/components/common/Login.vue'], resolve)
    },
    {
      path: '/main',
      component: resolve => require(['@/components/common/Main.vue'], resolve),
      children: [
        {
          path: '/',
          component: resolve => require(['@/components/common/Home.vue'],resolve)
        },
        {
          path: '/newsAdd',
          component: resolve => require(['@/components/news/NewsAdd.vue'],resolve)
        },
        {
          path: '/news',
          component: resolve => require(['@/components/news/News.vue'],resolve)
        },
        {
          path: '/menu',
          component: resolve => require(['@/components/system/Menu.vue'],resolve)
        },
        {
          path: '/role',
          component: resolve => require(['@/components/system/Role.vue'],resolve)
        },
      ]
    },
    
    
  ]
})
